jQuery(document).ready(function() {
  // Stuff to do as soon as the DOM is ready;
  // REGISTER CHECK FORM
    var reg = $('#form-register');
    reg.validate({
      rules:{
        name: "required",
        password: {
          required: true,
          minlength: 5
          },
        confirmpassword: {
          required: true,
          minlength: 5,
          equalTo: "#password"
          },
        email: {
          required: true,
          email: true
        },
        phone:{
          required: true,
          number: true
        }
      },
      messages:{
        name: "<em>W</em> Enter your lastname",
        password:{
          required: "<em>W</em> Provide a password",
          rangelength: jQuery.format("<em>W</em> Enter at least {0} characters")
        },
        confirmpassword:{
          required: "<em>W</em> Repeat your password",
          minlength: jQuery.format("<em>W</em> Enter at least {0} characters"),
          equalTo: "<em>W</em> Enter the same password as above"
        },
        email: {
          required: "<em>W</em> Please enter a valid email address",
          minlength: "<em>W</em> Please enter a valid email address",
        },
        phone:{
          required:"<em>W</em> Provide your phone",
          minlength: "<em>W</em> Only accept number.",
        }
      }
    });
});

